﻿<br />
<a href="#/StudyGroup" class=" breadcrumb">Schedule a study group</a>
<a href="#/AddANote" class="btn btn-primary">Add A New Note</a><br />
<!--<a href="#/UserNoteIndex" class="btn btn-info" ng-click="getNotes();">View Notes</a><br />-->
<!--<a href="#/UserNoteIndex" class="btn btn-info">View Notes</a><br />-->
<br /><br />
<!---<div ng-controller="SearchController">
    <form class="form-inline">
        <input ng-model="query" type="text"
               placeholder="Search notes......." autofocus>
    </form>
    <ul ng-repeat="note in notes" | filter:query>
        <li>{{note}}</li>
    </ul>
    <<ul ng-repeat="note in notes">
        <li>{{n.notes}}</li>
    </ul>
</div>--->

<div ng-repeat="n in notes track by $index">
    <span class="hidden">
        <span ng-hide="editing">{{n.Id}}</span>
        <input class="form-control" ng-model="n.Id" ng-hide="!editing" />
    </span>

    <h2>
        <span ng-hide="editing">{{n.Title}}</span>
        <input class="form-control" ng-model="n.Title" ng-hide="!editing" />
    </h2>
    <h4>
        Subject:  <span ng-hide="editing">{{n.Subject}}</span>
        <input class="form-control" ng-model="n.Subject" ng-hide="!editing" />
    </h4>

    <h4>
        School: <span ng-hide="editing">{{n.School}}</span>
        <input class="form-control" ng-model="n.School" ng-hide="!editing" />
    </h4>
    <h4>
        Public Note: <span ng-hide="editing">{{n.IsPublic}}</span>
        <input type="checkbox" class="form-control" ng-model="n.IsPublic" ng-hide="!editing" />
    </h4>
    <h4>
        Teacher: <span ng-hide="editing">{{n.IsTeaching}}</span>
        <input type="checkbox" class="form-control" ng-model="n.IsTeaching" ng-hide="!editing" />
    </h4>
    <h4>
        <span ng-hide="editing">{{n.NoteDate | date: 'short'}}</span>
        <input class="form-control" ng-model="n.NoteDate" ng-hide="!editing" />
    </h4>
    <h3>
        <span ng-hide="editing">{{n.NoteText}}</span>
        <input class="form-control" ng-model="n.NoteText" ng-hide="!editing" />
    </h3>

    <!--<button class="btn btn-warning" ng-click="editNote($index)">Edit</button>-->
    <button class="btn btn-warning" ng-click="editing = true" ng-hide="editing">Edit</button>
    <button class="btn btn-warning" ng-click="editing = false; updateNote(n);" ng-hide="!editing">Save</button>
    <button class="btn btn-warning" ng-click="editing = false; getNotes();" ng-hide="!editing">Cancel</button>
    <button class="btn btn-danger" ng-click="deleteNote($index);">Delete</button>
    <!--<button class="btn btn-primary" ng-click="viewNoteDetails($index);">Note Details</button>-->
    <a href="#/NoteDetails" class="btn btn-info">Note Details</a><br />
</div>

<br />